fix: guard rename/update_url actions against empty remote list#2870
Merged
extrawurst merged 3 commits intogitui-org:masterfrom Mar 19, 2026
Merged
fix: guard rename/update_url actions against empty remote list#2870extrawurst merged 3 commits intogitui-org:masterfrom
extrawurst merged 3 commits intogitui-org:masterfrom
Conversation
extrawurst
requested changes
Mar 5, 2026
Collaborator
extrawurst
left a comment
There was a problem hiding this comment.
Thanks for your contribution. looks good to me. Please add a changelog entry and we are gtg
30acb93 to
5bbe31f
Compare
Contributor
Author
|
Hi @extrawurst, the changelog entry was already added in commit 25ab784. Please take another look when you get a chance! 🙏 |
Contributor
Author
|
Hi! The changelog entry has already been added in the PR: Let me know if anything else is needed, happy to adjust! |
alerque
suggested changes
Mar 19, 2026
The rename_remote() and update_remote_url() event handlers in RemoteListPopup did not check valid_selection() before indexing into self.remote_names, causing a panic (index out of bounds) when no remotes are configured. The delete_remote() handler already had this guard. This commit adds the same valid_selection() check to the other two handlers for consistency. Fixes gitui-org#2868 Fixes gitui-org#2869
e3ac866 to
14755a8
Compare
Contributor
Author
|
Thanks for the review, @alerque! I've resolved the merge conflict in CHANGELOG.md — the branch was rebased onto the current master, incorporating the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request fixes/closes #2868, #2869.
It changes the following:
valid_selection()guard torename_remoteevent handler branchvalid_selection()guard toupdate_remote_urlevent handler branch## Unreleased→### FixesThese guards match the existing pattern on
delete_remote, preventing an index-out-of-bounds panic when the remote list is empty.I followed the checklist:
RemoteListPopuphas no existing test infrastructure (new()requires fullEnvironment); the fix is a 2-line guard addition matching the existingdelete_remotepatternmake checkwithout errors